<template>
  <div>
    <div>
      <el-row>
        <el-col :span="6">日志标题</el-col>
        <el-col :span="18">{{post.title}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="6">所属项目</el-col>
        <el-col :span="18">{{post.project}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="6">作者</el-col>
        <el-col :span="18">{{post.username}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="6">创建时间</el-col>
        <el-col :span="18">{{post.createTime}}</el-col>
      </el-row>
    </div>
    <div class="ql-container ql-snow">
      <div class="ql-editor" v-html="post.content"></div>
    </div>
  </div>
</template>

<script>
import {
  getprojectinfos,
  postprojectinfos,
  getinfosbyid,
  postinfosbyid
} from "@/api/table";

export default {
  data() {
    return {
      postId: null,
      post: {
        title: null,
        project: null,
        username: null,
        createTime: null,
        content: null
      }
    };
  },
  created() {
    this.postId = this.$route.params.id;
    this.getpost();
  },
  methods: {
    getpost() {
      getinfosbyid("showpost", this.postId).then(res => {
        this.post = res.data;
      });
    }
  }
};
</script>

